<?php

/**
 * RateHistory filter form base class.
 *
 * @package    Amman to London
 * @subpackage filter
 * @author     Adel Abu-Saif <adeljas@msn.com>
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseRateHistoryFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'model'    => new sfWidgetFormChoice(array('choices' => array('' => '', 'doseyeh' => 'doseyeh', 'comment' => 'comment'))),
      'user_id'  => new sfWidgetFormFilterInput(),
      'model_id' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'model'    => new sfValidatorChoice(array('required' => false, 'choices' => array('doseyeh' => 'doseyeh', 'comment' => 'comment'))),
      'user_id'  => new sfValidatorPass(array('required' => false)),
      'model_id' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('rate_history_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'RateHistory';
  }

  public function getFields()
  {
    return array(
      'id'       => 'Number',
      'model'    => 'Enum',
      'user_id'  => 'Text',
      'model_id' => 'Number',
    );
  }
}
